home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
gameprt.exe
/
GAMEDEMO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-18
|
1KB
|
53 lines
/*
Compile with Borland C++ 2.0 using the supplied make file
make -fgamedemo.mak
*/
#include <stdio.h>
#include <conio.h>
#include <dos.h>
void main()
{
int i, j, lasti, lastj;
int b, b1, b2;
int data[8];
clrscr();
_setcursortype(_NOCURSOR);
while (!kbhit()) {
delay(10);
i = stickx();
if (lasti != i) {
lasti = i;
gotoxy(1, 1);
printf("X = %3d", i);
}
delay(10);
j = sticky();
if (lastj != j) {
lastj = j;
gotoxy(1, 2);
printf("Y = %3d", j);
}
b = button1();
if (b1 != b) {
b1 = b;
gotoxy(1, 3);
printf("BUTTON1: %s", (b1) ? "ON " : "OFF");
}
b = button2();
if (b2 != b) {
b2 = b;
gotoxy(1, 4);
printf("BUTTON2: %s", (b2) ? "ON " : "OFF");
}
}
while (kbhit()) /* Gobble keyboard input */
getch();
_setcursortype(_NORMALCURSOR);
clrscr();
}